const state = {
    routeUrl: "/", //跳转的路由地址
    deptId: "", //部门id
    nations: [], //民族
    sexs: [], //性别
    highestEducations: [], //最高学历
    emergencyContacts: [], //联系人关系
    inductionChannels: [], //入职渠道
    idCardNo: "", //身份证
    phonenumber: "", //手机号
    userInfo: {}, //用户信息
    isSign: false, //是否已经签名
    recommendChannel: [], //入职渠道-推荐
    recommendThirtyChannel: [], //入职渠道-三方招聘
    stepType: 1,
    // 鼓励政策PDF URL
    encouragePdf: '',
    // 是否存在骑王活动
    haveRiderActivity: false,
    // 当前二维码类型
    qrCodeType: '',
    // 当前二维码面向员工类型
    staffType: 1,
    // 当前二维码ID
    qrCodeId: null
};

const mutations = {
    UPDATE_ROUTEURL(state, url) {
        uni.navigateTo({
            url,
        });
    },
    UPDATE_USERINFO(state, obj) {
        if (Object.prototype.toString.call(obj) === "[object Object]") {
            state.userInfo = obj;
        }
    },
    UPDATE_DEPTID(state, text) {
        state.deptId = text;
    },
    UPDATE_NATIONS(state, arr) {
        state.nations = arr;
    },
    UPDATE_SEXS(state, arr) {
        state.sexs = arr;
    },
    UPDATE_HIGHTEDU(state, arr) {
        state.highestEducations = arr;
    },
    UPDATE_CONTACTS(state, arr) {
        state.emergencyContacts = arr;
    },
    UPDATE_CHANNEL(state, arr) {
        state.inductionChannels = arr;
    },
    UPDATE_IDCARDNO(state, text) {
        state.idCardNo = text;
    },
    UPDATE_MOBILE(state, text) {
        state.phonenumber = text;
    },
    UPDATE_SIGN_STATUS(state, text) {
        state.isSign = text;
    },
    UPDATE_RECOMMEND_CHANNEL(state, arr) {
        state.recommendChannel = arr;
    },
    UPDATE_RECOMMEND_THIRTY_COMPANY_CHANNEL(state, arr) {
        state.recommendThirtyChannel = arr;
    },
    UPDATE_STEPTYPE(state, params) {
        state.stepType = params;
    },
    UPDATE_ENCOURAGE_PDF(state, pdf) {
        state.encouragePdf = pdf
    },
    UPDATE_HAVE_ACTIVITY(state, haveActivity) {
        state.haveRiderActivity = haveActivity
    },
    UPDATE_QR_CODE_TYPE(state, type) {
        state.qrCodeType = type
    },
    UPDATE_STAFF_TYPE(state, staffType) {
        state.staffType = staffType
    },
    UPDATE_QR_CODE_ID(state, id) {
      state.qrCodeId = id
    },
    SET_ORDER_INFO(state, obj) {
      state.orderInfo = obj
    }
};

const actions = {};

export default {
    state,
    mutations,
    actions,
};
